package com.example.stlink.model.constants;

import okhttp3.Credentials;
import okhttp3.MediaType;

/**
 * 存放网络请求相关的静态资源
 */
public final class UrlConstants {
    private UrlConstants(){}

/*==================================================================================================*/
    //个人身份昵称
    public static final String APP_USER_NAME = "helloWorld";
    //个人身份密码
    public static final String APP_PASSWORD = "HelloWorld,1234";
    //网页登陆之后的token
    public static final String TOKEN = "bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NTQ2ODM3MTMsInVzZXJfbmFtZSI6IjUiLCJhdXRob3JpdGllcyI6WyJST0xFX1VTRVIiXSwianRpIjoiMjRhZmQ1MzUtN2EzNy00MjFkLWJiYmEtM2M5ZTQ1ZmIyYzRiIiwiY2xpZW50X2lkIjoiY29pbi1hcGkiLCJzY29wZSI6WyJhbGwiXX0.Hn5ZkEde27mGMkJpY9fOR40wSfI5BDCVRB4tU9AUMnI0jPKFUFkBRqkgcVtjG9HwYWAn-QwtqfpmBwBY5IAf_iIJpfwnXes5bBABUsOGgbNOtSGzTBMhcAtqU-NshuFdPdgBtNvOJkDLx7E2IP3xOPEDTBc9i1eu16IHfyYmRHCE3zRpo2qd1DdP0VuIa_D8JJ7WaEVqFOqS7e1QC7Jfm6eFKAfFPzct6alRiXpoEOq0WLVKdUbD_EjV7GsjT-tmOWGEtKvnZgmhu5Y_LrNhG-iv1lxlEZU3QyDCWs6pVLb03tZe-AIHJl6T-Avjp7uCec3aiOKXjcKgJEDTI-GqYw";
    //身份。。。
    public static final String CREDENTIAL = Credentials.basic(UrlConstants.APP_USER_NAME, UrlConstants.APP_PASSWORD);
    //服务器前面公共的地址
    public static final String SERVER_URL = "http://47.107.52.7:88/member/sign";
    //服务器分配的应用ID
    public static final String APP_ID = "f39a68c119c34771bfae34a59587ab4e";
    //请求服务器时携带的密码
    public static final String APP_SECRET = "60868270e85186e18489285b5c6e43d50c085";
    //请求头参数
    public static final String HEAD_PARAM = "?" + "&appId=" + UrlConstants.APP_ID
                                          + "&appSecret=" + UrlConstants.APP_SECRET;
    // 每次请求结果多少
    public static final Integer PAGE_SIZE = 10;
    //媒体请求类型
    public static final MediaType MEDIA_TYPE_JSON = MediaType.parse("application/json; charset=utf-8");
    //定义图片文件解析，下面的 * 代表的是要上传的图片的格式，比如：png、jpg、JPEG等等
    public static final MediaType MEDIA_TYPE_PNG = MediaType.parse("image/*");
    //身份校验
    public static final String AUTHORIZATION = TOKEN;
/*==================================================================================================*/
    public static final String IS_IMG_UPLOAD_SUCCESS = "isImgUploadSuccess";
/*==================================================================================================*/
    //课程
    public static final String COURSE = "/course";
    //学生
    public static final String STUDENT = "/student";
    //教师
    public static final String TEACHER = "/teacher";
    //用户
    public static final String USER = "/user";
    //用户相关
    public static final String USER_URL = SERVER_URL + USER;
    //课程相关
    public static final String COURSE_URL = SERVER_URL + COURSE;
    //学生相关
    public static final String STUDENT_URL = COURSE_URL + STUDENT;
    //教师相关
    public static final String TEACHER_URL = COURSE_URL + TEACHER;
/*--------------------------------------------------------------------------------------------------*/
    // 用户注册
    public static final String USER_REGISTER = USER_URL + "/register";
    // 用户登录
    public static final String USER_LOGIN = USER_URL + "/login";
    // 修改用户个人信息
    public static final String USER_UPDATE = USER_URL + "/update";
/*--------------------------------------------------------------------------------------------------*/
    //上传图片
    public static final String FILE_UPLOAD = SERVER_URL + "/image/upload";
/*--------------------------------------------------------------------------------------------------*/
    // 分页获取全部课程列表
    public static final String ALL_COURSE = COURSE_URL + "/all";
    // 获取单个课程详情
    public static final String COURSE_DETAIL = COURSE_URL + "/detail";
/*--------------------------------------------------------------------------------------------------*/
    //学生用户获取自己所加入的课程
    public static final String STUDENT_COURSE = STUDENT_URL;
    //学生选课
    public static final String STUDENT_SELECT = STUDENT_URL + "/select";
    //学生退课
    public static final String STUDENT_DROP = STUDENT_URL + "/drop";
    //学生签到
    public static final String STUDENT_SIGN = STUDENT_URL + "/sign";
    //学生用户获取所选课程中的签到列表
    public static final String STUDENT_SIGN_LIST = STUDENT_URL + "/signList";
/*--------------------------------------------------------------------------------------------------*/
    // 教师添加课程POST & 教师删除课程DELETE
    public static final String TEACHER_COURSE = TEACHER_URL;
    //查看当前教师用户的已经结课的课程列表
    public static final String TEACHER_FINISHED = TEACHER_URL + "/finished";
    //查看当前教师用户的未结课的课程列表
    public static final String TEACHER_UNFINISHED = TEACHER_URL + "/unfinished";
    //教师端发起签到
    public static final String TEACHER_INITIATE = TEACHER_URL + "/initiate";
    //教师获取签到界面数据信息
    public static final String TEACHER_PAGE = TEACHER_URL + "/page";
/*==================================================================================================*/

}
